namespace SimpleWebServices
{
    using System;
    using System.Xml.Serialization;
    using Xunit;

    public sealed class TypeExtensionMethodsFacts
    {
        [Fact]
        public void typedef()
        {
            Assert.True(typeof(TypeExtensionMethods).IsStatic());
        }

        [Fact]
        public void op_Implements_TypeNull_Type()
        {
            Assert.Throws<ArgumentNullException>(() => (null as Type).Implements(typeof(IComparable)));
        }

        [Fact]
        public void op_Implements_Type_TypeNull()
        {
            Assert.Throws<ArgumentNullException>(() => typeof(DateTime).Implements(null as Type));
        }

        [Fact]
        public void op_Implements_Type_Type_whenTrue()
        {
            Assert.True(typeof(DateTime).Implements(typeof(IComparable)));
        }

        [Fact]
        public void op_Implements_Type_Type_whenFalse()
        {
            Assert.False(typeof(DateTime).Implements(typeof(IXmlSerializable)));
        }
    }
}